import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserModule } from './user/user.module';
import { User } from './user/entities/user.entity';
import { ConfigModule } from '@nestjs/config';
import { ChatModule } from './chat/chat.module';
@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
    }),
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'yang',
      password: '123456',
      database: 'knowledge_graph',
      entities: [__dirname + '/../**/*.entity{.ts,.js}'],
      synchronize: true   // 开发环境使用
    }),
    UserModule,
    ChatModule
  ]
})
export class AppModule {}